<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>

    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, maximum-scale=1.0, minimum-scale=1.0">
    <link rel="stylesheet" th:href="@{/css/base.css}">


    <title>用户列表</title>
</head>
<body>

<div th:replace="~{common-page/header.html :: myHeader}"></div>

<h1>用户列表</h1>

<table>
    <thead>
    <tr>
        <th>ID</th>
<!--        <th>UserID</th>-->
        <th>昵称</th>
        <th>创建时间</th>
    </tr>
    </thead>
    <tbody>
    <tr th:each="user : ${userPage.content}">
        <td th:text="${user.id}">1</td>
<!--        <td th:text="${user.userid}">uid</td>-->
        <td th:text="${user.nickname}">昵称</td>
        <td th:text="${user.createtime?.format(T(java.time.format.DateTimeFormatter).ofPattern('yyyy-MM-dd HH:mm:ss'))}"></td>
    </tr>
    </tbody>
</table>








<!--                           分页组件 start                      -->
<style>
    .pagination {
        display: flex;
        justify-content: center;
        gap: 10px;
        margin-top: 20px;
        padding: 10px;
        background-color: #1e1e1e;
        color: #ffffff;
        border-radius: 8px;
        font-family: sans-serif;
        font-size: 20px;
    }

    .pagination a {
        padding: 8px 24px;
        text-decoration: none;
        color: #ffffff;
        background-color: #333333;
        border: 1px solid #555;
        border-radius: 4px;
        transition: background-color 0.2s ease;
        font-size: 20px;
    }

    .pagination a:hover {
        background-color: #444;
        border-color: #777;
    }

    .pagination span {
        padding: 8px 12px;
        background-color: #2c2c2c;
        border-radius: 4px;
        border: 1px solid #555;
        font-size: 20px;
    }
    .left-right-arrowhead a {
        font-size: 30px;
    }
</style>
<div class="pagination">
    <a th:if="${userPage.number > 0}" th:href="@{/users(page=0)}"> 1 </a>   <!-- 首页 -->
    <span>  [[${userPage.number + 1}]] /  [[${userPage.totalPages}]] </span>          <!-- 当前页 / 总页数 -->
    <!-- 尾页 -->
    <a th:if="${userPage.number < userPage.totalPages - 1}"
       th:href="@{/users(page=${userPage.totalPages - 1})}">
        [[${userPage.totalPages}]]
    </a>
</div>

             javanote

<h1  th:text="${userPage.totalPages}"></h1>
<h1  th:text="${userPage.total}"></h1>

<div style="height: 300px; "></div>
<!--                           分页组件  end                        -->
























</body>
</html>
